<template>
  <div id="app">
    <router-view/>
    <v-snackbar :timeout="3000" bottom right :color="snackbar.color" v-model="snackbar.show">
      {{ snackbar.text }}
      <v-btn dark flat @click.native="snackbar.show = false" icon>
        <v-icon>close</v-icon>
      </v-btn>
    </v-snackbar>
  </div>
</template>

<script>
import AppEvents from './event'
export default {
  name: 'App',
  components: {},
  data: () => ({
    snackbar: {
      show: false,
      text: '',
      color: ''
    }
  }),
  created() {
    AppEvents.forEach(item => {
      this.$on(item.name, item.callback)
    })
    window.getApp = this
  }
}
</script>
